!function(e) {
    "use strict";
    function t() {
        var e = ['<div class="player-controls">', '<div class="player-progress">', '<label for="seek{id}" class="sr-only">Seek</label>', '<input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek">', '<progress class="player-progress-played" max="100" value="0">', "<span>0</span>% " + C.i18n.played, "</progress>", '<progress class="player-progress-buffer" max="100" value="0">', "<span>0</span>% " + C.i18n.buffered, "</progress>", "</div>", '<span class="player-controls-left">'];
        return o(C.controls, "restart") && e.push('<button type="button" data-player="restart">', '<svg><use xlink:href="#' + C.iconPrefix + '-restart" /></svg>', '<span class="sr-only">' + C.i18n.restart + "</span>", "</button>"),
        o(C.controls, "rewind") && e.push('<button type="button" data-player="rewind">', '<svg><use xlink:href="#' + C.iconPrefix + '-rewind" /></svg>', '<span class="sr-only">' + C.i18n.rewind + "</span>", "</button>"),
        o(C.controls, "play") && e.push('<button type="button" data-player="play">', '<svg><use xlink:href="#' + C.iconPrefix + '-play" /></svg>', '<span class="sr-only">' + C.i18n.play + "</span>", "</button>", '<button type="button" data-player="pause">', '<svg><use xlink:href="#' + C.iconPrefix + '-pause" /></svg>', '<span class="sr-only">' + C.i18n.pause + "</span>", "</button>"),
        o(C.controls, "fast-forward") && e.push('<button type="button" data-player="fast-forward">', '<svg><use xlink:href="#' + C.iconPrefix + '-fast-forward" /></svg>', '<span class="sr-only">' + C.i18n.forward + "</span>", "</button>"),
        o(C.controls, "current-time") && e.push('<span class="player-time">', '<span class="sr-only">' + C.i18n.currentTime + "</span>", '<span class="player-current-time">00:00</span>', "</span>"),
        o(C.controls, "duration") && e.push('<span class="player-time">', '<span class="sr-only">' + C.i18n.duration + "</span>", '<span class="player-duration">00:00</span>', "</span>"),
        e.push("</span>", '<span class="player-controls-right">'),
        o(C.controls, "mute") && e.push('<button type="button" data-player="mute">', '<svg class="icon-muted"><use xlink:href="#' + C.iconPrefix + '-muted" /></svg>', '<svg><use xlink:href="#' + C.iconPrefix + '-volume" /></svg>', '<span class="sr-only">' + C.i18n.toggleMute + "</span>", "</button>"),
        o(C.controls, "volume") && e.push('<label for="volume{id}" class="sr-only">' + C.i18n.volume + "</label>", '<input id="volume{id}" class="player-volume" type="range" min="0" max="10" value="5" data-player="volume">'),
        o(C.controls, "captions") && e.push('<button type="button" data-player="captions">', '<svg class="icon-captions-on"><use xlink:href="#' + C.iconPrefix + '-captions-on" /></svg>', '<svg><use xlink:href="#' + C.iconPrefix + '-captions-off" /></svg>', '<span class="sr-only">' + C.i18n.toggleCaptions + "</span>", "</button>"),
        o(C.controls, "fullscreen") && e.push('<button type="button" data-player="fullscreen">', '<svg class="icon-exit-fullscreen"><use xlink:href="#' + C.iconPrefix + '-exit-fullscreen" /></svg>', '<svg><use xlink:href="#' + C.iconPrefix + '-enter-fullscreen" /></svg>', '<span class="sr-only">' + C.i18n.toggleFullscreen + "</span>", "</button>"),
        e.push("</span>", "</div>"),
        e.join("")
    }
    function n(e, t) {
        C.debug && window.console && console[t ? "error" : "log"](e)
    }
    function r() {
        var e, t, n, r = navigator.userAgent, a = navigator.appName, s = "" + parseFloat(navigator.appVersion), o = parseInt(navigator.appVersion, 10);
        return -1 !== navigator.appVersion.indexOf("Windows NT") && -1 !== navigator.appVersion.indexOf("rv:11") ? (a = "IE",
        s = "11;") : -1 !== (t = r.indexOf("MSIE")) ? (a = "IE",
        s = r.substring(t + 5)) : -1 !== (t = r.indexOf("Chrome")) ? (a = "Chrome",
        s = r.substring(t + 7)) : -1 !== (t = r.indexOf("Safari")) ? (a = "Safari",
        s = r.substring(t + 7),
        -1 !== (t = r.indexOf("Version")) && (s = r.substring(t + 8))) : -1 !== (t = r.indexOf("Firefox")) ? (a = "Firefox",
        s = r.substring(t + 8)) : (e = r.lastIndexOf(" ") + 1) < (t = r.lastIndexOf("/")) && (a = r.substring(e, t),
        s = r.substring(t + 1),
        a.toLowerCase() == a.toUpperCase() && (a = navigator.appName)),
        -1 !== (n = s.indexOf(";")) && (s = s.substring(0, n)),
        -1 !== (n = s.indexOf(" ")) && (s = s.substring(0, n)),
        o = parseInt("" + s, 10),
        isNaN(o) && (s = "" + parseFloat(navigator.appVersion),
        o = parseInt(navigator.appVersion, 10)),
        {
            name: a,
            version: o,
            ios: /(iPad|iPhone|iPod)/g.test(navigator.platform)
        }
    }
    function a(e, t) {
        var n = e.media;
        if ("video" == e.type)
            switch (t) {
            case "video/webm":
                return !(!n.canPlayType || !n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/, ""));
            case "video/mp4":
                return !(!n.canPlayType || !n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ""));
            case "video/ogg":
                return !(!n.canPlayType || !n.canPlayType('video/ogg; codecs="theora"').replace(/no/, ""))
            }
        else if ("audio" == e.type)
            switch (t) {
            case "audio/mpeg":
                return !(!n.canPlayType || !n.canPlayType("audio/mpeg;").replace(/no/, ""));
            case "audio/ogg":
                return !(!n.canPlayType || !n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, ""));
            case "audio/wav":
                return !(!n.canPlayType || !n.canPlayType('audio/wav; codecs="1"').replace(/no/, ""))
            }
        return !1
    }
    function s(e) {
        if (!document.querySelectorAll('script[src="' + e + '"]').length) {
            var t = document.createElement("script");
            t.src = e;
            var n = document.getElementsByTagName("script")[0];
            n.parentNode.insertBefore(t, n)
        }
    }
    function o(e, t) {
        return Array.prototype.indexOf && -1 != e.indexOf(t)
    }
    function i(e, t, n) {
        return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g, "\\$1"),"g"), n)
    }
    function l(e, t) {
        e.length || (e = [e]);
        for (var n = e.length - 1; n >= 0; n--) {
            var r = n > 0 ? t.cloneNode(!0) : t
              , a = e[n]
              , s = a.parentNode
              , o = a.nextSibling;
            r.appendChild(a),
            o ? s.insertBefore(r, o) : s.appendChild(r)
        }
    }
    function u(e) {
        for (var t = e.parentNode; e.firstChild; )
            t.insertBefore(e.firstChild, e);
        t.removeChild(e)
    }
    function c(e) {
        e.parentNode.removeChild(e)
    }
    function p(e, t) {
        e.insertBefore(t, e.firstChild)
    }
    function d(e, t) {
        for (var n in t)
            e.setAttribute(n, t[n])
    }
    function f(e, t, n) {
        if (e)
            if (e.classList)
                e.classList[n ? "add" : "remove"](t);
            else {
                var r = (" " + e.className + " ").replace(/\s+/g, " ").replace(" " + t + " ", "");
                e.className = r + (n ? " " + t : "")
            }
    }
    function m(e, t, n, r) {
        var a = t.split(" ");
        if (e instanceof NodeList)
            for (var s = 0; s < e.length; s++)
                e[s]instanceof Node && m(e[s], arguments[1], arguments[2], arguments[3]);
        else
            for (var o = 0; o < a.length; o++)
                e[r ? "addEventListener" : "removeEventListener"](a[o], n, !1)
    }
    function y(e, t, n) {
        e && m(e, t, n, !0)
    }
    function b(e, t, n) {
        e && m(e, t, n, !1)
    }
    function v(e, t) {
        var n = document.createEvent("MouseEvents");
        n.initEvent(t, !0, !0),
        e.dispatchEvent(n)
    }
    function g(e, t) {
        return t = "boolean" == typeof t ? t : !e.getAttribute("aria-pressed"),
        e.setAttribute("aria-pressed", t),
        t
    }
    function h(e, t) {
        return 0 === e || 0 === t || isNaN(e) || isNaN(t) ? 0 : (e / t * 100).toFixed(2)
    }
    function w(e, t) {
        for (var n in t)
            t[n] && t[n].constructor && t[n].constructor === Object ? (e[n] = e[n] || {},
            w(e[n], t[n])) : e[n] = t[n];
        return e
    }
    function k() {
        var e = {
            supportsFullScreen: !1,
            isFullScreen: function() {
                return !1
            },
            requestFullScreen: function() {},
            cancelFullScreen: function() {},
            fullScreenEventName: "",
            element: null,
            prefix: ""
        }
          , t = "webkit moz o ms khtml".split(" ");
        if ("undefined" != typeof document.cancelFullScreen)
            e.supportsFullScreen = !0;
        else
            for (var n = 0, r = t.length; r > n; n++) {
                if (e.prefix = t[n],
                "undefined" != typeof document[e.prefix + "CancelFullScreen"]) {
                    e.supportsFullScreen = !0;
                    break
                }
                if ("undefined" != typeof document.msExitFullscreen && document.msFullscreenEnabled) {
                    e.prefix = "ms",
                    e.supportsFullScreen = !0;
                    break
                }
            }
        return e.supportsFullScreen && (e.fullScreenEventName = "ms" == e.prefix ? "MSFullscreenChange" : e.prefix + "fullscreenchange",
        e.isFullScreen = function(e) {
            switch ("undefined" == typeof e && (e = document.body),
            this.prefix) {
            case "":
                return document.fullscreenElement == e;
            case "moz":
                return document.mozFullScreenElement == e;
            default:
                return document[this.prefix + "FullscreenElement"] == e
            }
        }
        ,
        e.requestFullScreen = function(e) {
            return "undefined" == typeof e && (e = document.body),
            "" === this.prefix ? e.requestFullScreen() : e[this.prefix + ("ms" == this.prefix ? "RequestFullscreen" : "RequestFullScreen")]()
        }
        ,
        e.cancelFullScreen = function() {
            return "" === this.prefix ? document.cancelFullScreen() : document[this.prefix + ("ms" == this.prefix ? "ExitFullscreen" : "CancelFullScreen")]()
        }
        ,
        e.element = function() {
            return "" === this.prefix ? document.fullscreenElement : document[this.prefix + "FullscreenElement"]
        }
        ),
        e
    }
    function x() {
        var e = {
            supported: function() {
                try {
                    return "localStorage"in window && null !== window.localStorage
                } catch (e) {
                    return !1
                }
            }()
        };
        return e
    }
    function T(o) {
        function w(e) {
            if (!dt.usingTextTracks && "video" === dt.type && dt.supported.full) {
                for (dt.subcount = 0,
                e = "number" == typeof e ? e : dt.media.currentTime; E(dt.captions[dt.subcount][0]) < e.toFixed(1); )
                    if (dt.subcount++,
                    dt.subcount > dt.captions.length - 1) {
                        dt.subcount = dt.captions.length - 1;
                        break
                    }
                if (dt.media.currentTime.toFixed(1) >= S(dt.captions[dt.subcount][0]) && dt.media.currentTime.toFixed(1) <= E(dt.captions[dt.subcount][0])) {
                    dt.currentCaption = dt.captions[dt.subcount][1];
                    var t = dt.currentCaption.trim();
                    dt.captionsContainer.innerHTML != t && (dt.captionsContainer.innerHTML = "",
                    dt.captionsContainer.innerHTML = t)
                } else
                    dt.captionsContainer.innerHTML = ""
            }
        }
        function T() {
            dt.buttons.captions && (f(dt.container, C.classes.captions.enabled, !0),
            C.captions.defaultActive && (f(dt.container, C.classes.captions.active, !0),
            g(dt.buttons.captions, !0)))
        }
        function S(e) {
            var t = [];
            return t = e.split(" --> "),
            A(t[0])
        }
        function E(e) {
            var t = [];
            return t = e.split(" --> "),
            A(t[1])
        }
        function A(e) {
            if (null === e || void 0 === e)
                return 0;
            var t, n = [], r = [];
            return n = e.split(","),
            r = n[0].split(":"),
            t = Math.floor(60 * r[0] * 60) + Math.floor(60 * r[1]) + Math.floor(r[2])
        }
        function P(e) {
            return dt.container.querySelectorAll(e)
        }
        function N(e) {
            return P(e)[0]
        }
        function M() {
            try {
                return window.self !== window.top
            } catch (e) {
                return !0
            }
        }
        function I() {
            var e = C.html;
            if (n("Injecting custom controls."),
            e || (e = t()),
            e = i(e, "{seektime}", C.seekTime),
            e = i(e, "{id}", Math.floor(1e4 * Math.random())),
            dt.container.insertAdjacentHTML("beforeend", e),
            C.tooltips)
                for (var r = P(C.selectors.labels), a = r.length - 1; a >= 0; a--) {
                    var s = r[a];
                    f(s, C.classes.hidden, !1),
                    f(s, C.classes.tooltip, !0)
                }
        }
        function L() {
            try {
                return dt.controls = N(C.selectors.controls),
                dt.buttons = {},
                dt.buttons.seek = N(C.selectors.buttons.seek),
                dt.buttons.play = N(C.selectors.buttons.play),
                dt.buttons.pause = N(C.selectors.buttons.pause),
                dt.buttons.restart = N(C.selectors.buttons.restart),
                dt.buttons.rewind = N(C.selectors.buttons.rewind),
                dt.buttons.forward = N(C.selectors.buttons.forward),
                dt.buttons.fullscreen = N(C.selectors.buttons.fullscreen),
                dt.buttons.mute = N(C.selectors.buttons.mute),
                dt.buttons.captions = N(C.selectors.buttons.captions),
                dt.checkboxes = P('[type="checkbox"]'),
                dt.progress = {},
                dt.progress.container = N(C.selectors.progress.container),
                dt.progress.buffer = {},
                dt.progress.buffer.bar = N(C.selectors.progress.buffer),
                dt.progress.buffer.text = dt.progress.buffer.bar && dt.progress.buffer.bar.getElementsByTagName("span")[0],
                dt.progress.played = {},
                dt.progress.played.bar = N(C.selectors.progress.played),
                dt.progress.played.text = dt.progress.played.bar && dt.progress.played.bar.getElementsByTagName("span")[0],
                dt.volume = N(C.selectors.buttons.volume),
                dt.duration = N(C.selectors.duration),
                dt.currentTime = N(C.selectors.currentTime),
                dt.seekTime = P(C.selectors.seekTime),
                !0
            } catch (e) {
                return n("It looks like there's a problem with your controls html. Bailing.", !0),
                dt.media.setAttribute("controls", ""),
                !1
            }
        }
        function O() {
            if (dt.buttons.play) {
                var e = dt.buttons.play.innerText || C.i18n.play;
                "undefined" != typeof C.title && C.title.length && (e += ", " + C.title),
                dt.buttons.play.setAttribute("aria-label", e)
            }
        }
        function q() {
            if (!dt.media)
                return n("No audio or video element found!", !0),
                !1;
            if (dt.supported.full && (dt.media.removeAttribute("controls"),
            f(dt.container, C.classes.type.replace("{0}", dt.type), !0),
            f(dt.container, C.classes.stopped, null === dt.media.getAttribute("autoplay")),
            dt.browser.ios && f(dt.container, "ios", !0),
            "video" === dt.type)) {
                var e = document.createElement("div");
                e.setAttribute("class", C.classes.videoWrapper),
                l(dt.media, e),
                dt.videoContainer = e
            }
            "youtube" == dt.type && V(dt.media.getAttribute("data-video-id")),
            null !== dt.media.getAttribute("autoplay") && j()
        }
        function V(e) {
            for (var t = P('[id^="youtube"]'), n = t.length - 1; n >= 0; n--)
                c(t[n]);
            var r = document.createElement("div");
            r.setAttribute("id", "youtube-" + Math.floor(1e4 * Math.random())),
            dt.media.appendChild(r),
            f(dt.media, C.classes.videoWrapper, !0),
            f(dt.media, C.classes.embedWrapper, !0),
            "object" == typeof YT ? H(e, r) : (s("https://www.youtube.com/iframe_api"),
            window.onYouTubeIframeAPIReady = function() {
                H(e, r)
            }
            )
        }
        function H(e, t) {
            n("YouTube API Ready"),
            "timer"in dt || (dt.timer = {}),
            dt.embed = new YT.Player(t.id,{
                videoId: e,
                playerVars: {
                    autoplay: 0,
                    controls: dt.supported.full ? 0 : 1,
                    rel: 0,
                    showinfo: 0,
                    iv_load_policy: 3,
                    cc_load_policy: C.captions.defaultActive ? 1 : 0,
                    cc_lang_pref: "en",
                    wmode: "transparent",
                    modestbranding: 1,
                    disablekb: 1
                },
                events: {
                    onReady: function(e) {
                        var t = e.target;
                        dt.media.play = function() {
                            t.playVideo()
                        }
                        ,
                        dt.media.pause = function() {
                            t.pauseVideo()
                        }
                        ,
                        dt.media.stop = function() {
                            t.stopVideo()
                        }
                        ,
                        dt.media.duration = t.getDuration(),
                        dt.media.paused = !0,
                        dt.media.currentTime = t.getCurrentTime(),
                        dt.media.muted = t.isMuted(),
                        v(dt.media, "timeupdate"),
                        window.clearInterval(dt.timer.buffering),
                        dt.timer.buffering = window.setInterval(function() {
                            dt.media.buffered = t.getVideoLoadedFraction(),
                            v(dt.media, "progress"),
                            1 === dt.media.buffered && window.clearInterval(dt.timer.buffering)
                        }, 200),
                        dt.supported.full && (dt.container.querySelectorAll(C.selectors.controls).length || pt(),
                        C.displayDuration && nt())
                    },
                    onStateChange: function(e) {
                        var t = e.target;
                        switch (window.clearInterval(dt.timer.playing),
                        e.data) {
                        case 0:
                            dt.media.paused = !0,
                            v(dt.media, "ended");
                            break;
                        case 1:
                            dt.media.paused = !1,
                            v(dt.media, "play"),
                            dt.timer.playing = window.setInterval(function() {
                                dt.media.currentTime = t.getCurrentTime(),
                                v(dt.media, "timeupdate")
                            }, 200);
                            break;
                        case 2:
                            dt.media.paused = !0,
                            v(dt.media, "pause")
                        }
                    }
                }
            })
        }
        function R() {
            if ("video" === dt.type) {
                dt.videoContainer.insertAdjacentHTML("afterbegin", '<div class="' + C.selectors.captions.replace(".", "") + '"><span></span></div>'),
                dt.captionsContainer = N(C.selectors.captions).querySelector("span"),
                dt.usingTextTracks = !1,
                dt.media.textTracks && (dt.usingTextTracks = !0);
                for (var e, t = "", r = dt.media.childNodes, a = 0; a < r.length; a++)
                    "track" === r[a].nodeName.toLowerCase() && (e = r[a].kind,
                    ("captions" === e || "subtitles" === e) && (t = r[a].getAttribute("src")));
                if (dt.captionExists = !0,
                "" === t ? (dt.captionExists = !1,
                n("No caption track found.")) : n("Caption track found; URI: " + t),
                dt.captionExists) {
                    for (var s = dt.media.textTracks, o = 0; o < s.length; o++)
                        s[o].mode = "hidden";
                    if (T(dt),
                    ("IE" === dt.browser.name && dt.browser.version >= 10 || "Firefox" === dt.browser.name && dt.browser.version >= 31 || "Chrome" === dt.browser.name && dt.browser.version >= 43 || "Safari" === dt.browser.name && dt.browser.version >= 7) && (n("Detected unsupported browser for HTML5 captions. Using fallback."),
                    dt.usingTextTracks = !1),
                    dt.usingTextTracks) {
                        n("TextTracks supported.");
                        for (var i = 0; i < s.length; i++) {
                            var l = s[i];
                            ("captions" === l.kind || "subtitles" === l.kind) && y(l, "cuechange", function() {
                                dt.captionsContainer.innerHTML = "",
                                this.activeCues[0] && this.activeCues[0].hasOwnProperty("text") && dt.captionsContainer.appendChild(this.activeCues[0].getCueAsHTML().trim())
                            })
                        }
                    } else if (n("TextTracks not supported so rendering captions manually."),
                    dt.currentCaption = "",
                    dt.captions = [],
                    "" !== t) {
                        var u = new XMLHttpRequest;
                        u.onreadystatechange = function() {
                            if (4 === u.readyState)
                                if (200 === u.status) {
                                    var e, t = [], r = u.responseText;
                                    t = r.split("\n\n");
                                    for (var a = 0; a < t.length; a++)
                                        e = t[a],
                                        dt.captions[a] = [],
                                        dt.captions[a] = e.split("\n");
                                    dt.captions.shift(),
                                    n("Successfully loaded the caption file via AJAX.")
                                } else
                                    n("There was a problem loading the caption file via AJAX.", !0)
                        }
                        ,
                        u.open("get", t, !0),
                        u.send()
                    }
                    if ("Safari" === dt.browser.name && dt.browser.version >= 7) {
                        n("Safari 7+ detected; removing track from DOM."),
                        s = dt.media.getElementsByTagName("track");
                        for (var c = 0; c < s.length; c++)
                            dt.media.removeChild(s[c])
                    }
                } else
                    f(dt.container, C.classes.captions.enabled)
            }
        }
        function B() {
            if ("audio" != dt.type && C.fullscreen.enabled) {
                var e = F.supportsFullScreen;
                e || C.fullscreen.fallback && !M() ? (n((e ? "Native" : "Fallback") + " fullscreen enabled."),
                f(dt.container, C.classes.fullscreen.enabled, !0)) : n("Fullscreen not supported and fallback disabled."),
                g(dt.buttons.fullscreen, !1),
                C.fullscreen.hideControls && f(dt.container, C.classes.fullscreen.hideControls, !0)
            }
        }
        function j() {
            dt.media.play()
        }
        function D() {
            dt.media.pause()
        }
        function _(e) {
            e === !0 ? j() : e === !1 ? D() : dt.media[dt.media.paused ? "play" : "pause"]()
        }
        function W(e) {
            "number" != typeof e && (e = C.seekTime),
            z(dt.media.currentTime - e)
        }
        function Y(e) {
            "number" != typeof e && (e = C.seekTime),
            z(dt.media.currentTime + e)
        }
        function z(e) {
            var t = 0
              , r = dt.media.paused;
            "number" == typeof e ? t = e : "object" != typeof e || "input" !== e.type && "change" !== e.type || (t = e.target.value / e.target.max * dt.media.duration),
            0 > t ? t = 0 : t > dt.media.duration && (t = dt.media.duration);
            try {
                dt.media.currentTime = t.toFixed(1)
            } catch (a) {}
            "youtube" == dt.type && (dt.embed.seekTo(t),
            r && D(),
            v(dt.media, "timeupdate")),
            n("Seeking to " + dt.media.currentTime + " seconds"),
            w(t)
        }
        function U() {
            f(dt.container, C.classes.playing, !dt.media.paused),
            f(dt.container, C.classes.stopped, dt.media.paused)
        }
        function X(e) {
            function t() {
                f(dt.container, C.classes.hover, !0),
                window.clearTimeout(a),
                s || (a = window.setTimeout(function() {
                    f(dt.container, C.classes.hover, !1)
                }, 2e3))
            }
            function n(e) {
                s = "mouseenter" === e.type
            }
            var r = F.supportsFullScreen;
            e && e.type === F.fullScreenEventName ? dt.isFullscreen = F.isFullScreen(dt.container) : r ? (F.isFullScreen(dt.container) ? F.cancelFullScreen() : F.requestFullScreen(dt.container),
            dt.isFullscreen = F.isFullScreen(dt.container)) : (dt.isFullscreen = !dt.isFullscreen,
            dt.isFullscreen ? (y(document, "keyup", J),
            document.body.style.overflow = "hidden") : (b(document, "keyup", J),
            document.body.style.overflow = "")),
            f(dt.container, C.classes.fullscreen.active, dt.isFullscreen),
            g(dt.buttons.fullscreen, dt.isFullscreen);
            var a, s = !1;
            C.fullscreen.hideControls && (f(dt.controls, C.classes.hover, !1),
            m(dt.controls, "mouseenter mouseleave", n, dt.isFullscreen),
            m(dt.container, "mousemove", t, dt.isFullscreen))
        }
        function J(e) {
            27 === (e.which || e.charCode || e.keyCode) && dt.isFullscreen && X()
        }
        function $(e) {
            "undefined" == typeof e && (e = C.storage.enabled && x().supported ? window.localStorage[C.storage.key] || C.volume : C.volume),
            e > 10 && (e = 10),
            0 > e && (e = 0),
            dt.media.volume = parseFloat(e / 10),
            "youtube" == dt.type && (dt.embed.setVolume(100 * dt.media.volume),
            v(dt.media, "volumechange")),
            dt.media.muted && e > 0 && G()
        }
        function G(e) {
            "boolean" != typeof e && (e = !dt.media.muted),
            g(dt.buttons.mute, e),
            dt.media.muted = e,
            "youtube" === dt.type && (dt.embed[dt.media.muted ? "mute" : "unMute"](),
            v(dt.media, "volumechange"))
        }
        function K() {
            var e = dt.media.muted ? 0 : 10 * dt.media.volume;
            dt.supported.full && dt.volume && (dt.volume.value = e),
            C.storage.enabled && x().supported && window.localStorage.setItem(C.storage.key, e),
            f(dt.container, C.classes.muted, 0 === e),
            dt.supported.full && dt.buttons.mute && g(dt.buttons.mute, 0 === e)
        }
        function Q(e) {
            dt.supported.full && dt.buttons.captions && ("boolean" != typeof e && (e = -1 === dt.container.className.indexOf(C.classes.captions.active)),
            g(dt.buttons.captions, e),
            f(dt.container, C.classes.captions.active, e))
        }
        function Z(e) {
            var t = "waiting" === e.type;
            clearTimeout(dt.loadingTimer),
            dt.loadingTimer = setTimeout(function() {
                f(dt.container, C.classes.loading, t)
            }, t ? 250 : 0)
        }
        function et(e) {
            var t = dt.progress.played.bar
              , n = dt.progress.played.text
              , r = 0;
            if (e)
                switch (e.type) {
                case "timeupdate":
                case "seeking":
                    r = h(dt.media.currentTime, dt.media.duration),
                    "timeupdate" == e.type && dt.buttons.seek && (dt.buttons.seek.value = r);
                    break;
                case "change":
                case "input":
                    r = e.target.value;
                    break;
                case "playing":
                case "progress":
                    t = dt.progress.buffer.bar,
                    n = dt.progress.buffer.text,
                    r = function() {
                        var e = dt.media.buffered;
                        return e && e.length ? h(e.end(0), dt.media.duration) : "number" == typeof e ? 100 * e : 0
                    }()
                }
            t && (t.value = r),
            n && (n.innerHTML = r)
        }
        function tt(e, t) {
            if (t) {
                dt.secs = parseInt(e % 60),
                dt.mins = parseInt(e / 60 % 60),
                dt.hours = parseInt(e / 60 / 60 % 60);
                var n = parseInt(dt.media.duration / 60 / 60 % 60) > 0;
                dt.secs = ("0" + dt.secs).slice(-2),
                dt.mins = ("0" + dt.mins).slice(-2),
                t.innerHTML = (n ? dt.hours + ":" : "") + dt.mins + ":" + dt.secs
            }
        }
        function nt() {
            var e = dt.media.duration || 0;
            !dt.duration && C.displayDuration && dt.media.paused && tt(e, dt.currentTime),
            dt.duration && tt(e, dt.duration)
        }
        function rt(e) {
            tt(dt.media.currentTime, dt.currentTime),
            et(e)
        }
        function at() {
            for (var e = dt.media.querySelectorAll("source"), t = e.length - 1; t >= 0; t--)
                c(e[t]);
            dt.media.removeAttribute("src")
        }
        function st(e) {
            if (e.src) {
                var t = document.createElement("source");
                d(t, e),
                p(dt.media, t)
            }
        }
        function ot(e) {
            if ("youtube" === dt.type && "string" == typeof e)
                return dt.embed.destroy(),
                V(e),
                rt(),
                void 0;
            if (D(),
            z(),
            at(),
            "string" == typeof e)
                st({
                    src: e
                });
            else if (e.constructor === Array)
                for (var t in e)
                    st(e[t]);
            dt.supported.full && (rt(),
            U()),
            dt.media.load(),
            null !== dt.media.getAttribute("autoplay") && j()
        }
        function it(e) {
            "video" === dt.type && dt.media.setAttribute("poster", e)
        }
        function lt() {
            function e() {
                var e = document.activeElement;
                e && e != document.body ? document.querySelector && (e = document.querySelector(":focus")) : e = null;
                for (var t in dt.buttons) {
                    var n = dt.buttons[t];
                    f(n, "tab-focus", n === e)
                }
            }
            var t = "IE" == dt.browser.name ? "change" : "input";
            y(window, "keyup", function(t) {
                var n = t.keyCode ? t.keyCode : t.which;
                9 == n && e()
            });
            for (var n in dt.buttons) {
                var r = dt.buttons[n];
                y(r, "blur", function() {
                    f(r, "tab-focus", !1)
                })
            }
            y(dt.buttons.play, "click", function() {
                j(),
                setTimeout(function() {
                    dt.buttons.pause.focus()
                }, 100)
            }),
            y(dt.buttons.pause, "click", function() {
                D(),
                setTimeout(function() {
                    dt.buttons.play.focus()
                }, 100)
            }),
            y(dt.buttons.restart, "click", z),
            y(dt.buttons.rewind, "click", W),
            y(dt.buttons.forward, "click", Y),
            y(dt.buttons.seek, t, z),
            y(dt.volume, t, function() {
                $(this.value)
            }),
            y(dt.buttons.mute, "click", G),
            y(dt.buttons.fullscreen, "click", X),
            F.supportsFullScreen && y(document, F.fullScreenEventName, X),
            y(dt.media, "timeupdate seeking", rt),
            y(dt.media, "timeupdate", w),
            y(dt.media, "loadedmetadata", nt),
            y(dt.buttons.captions, "click", Q),
            y(dt.media, "ended", function() {
                "video" === dt.type && (dt.captionsContainer.innerHTML = ""),
                U()
            }),
            y(dt.media, "progress playing", et),
            y(dt.media, "volumechange", K),
            y(dt.media, "play pause", U),
            y(dt.media, "waiting canplay seeked", Z),
            "video" === dt.type && C.click && y(dt.videoContainer, "click", function() {
                dt.media.paused ? v(dt.buttons.play, "click") : dt.media.ended ? (z(),
                v(dt.buttons.play, "click")) : v(dt.buttons.pause, "click")
            })
        }
        function ut() {
            if (!dt.init)
                return null;
            if (dt.container.setAttribute("class", C.selectors.container.replace(".", "")),
            dt.init = !1,
            c(N(C.selectors.controls)),
            "youtube" === dt.type)
                return dt.embed.destroy(),
                void 0;
            "video" === dt.type && (c(N(C.selectors.captions)),
            u(dt.videoContainer)),
            dt.media.setAttribute("controls", "");
            var e = dt.media.cloneNode(!0);
            dt.media.parentNode.replaceChild(e, dt.media)
        }
        function ct() {
            if (dt.init)
                return null;
            F = k(),
            dt.browser = r(),
            dt.media = dt.container.querySelectorAll("audio, video, div")[0];
            var t = dt.media.tagName.toLowerCase();
            if (dt.type = "div" === t ? dt.media.getAttribute("data-type") : t,
            dt.supported = e.supported(dt.type),
            !dt.supported.basic)
                return !1;
            if (n(dt.browser.name + " " + dt.browser.version),
            q(),
            "video" == dt.type || "audio" == dt.type) {
                if (!dt.supported.full)
                    return dt.init = !0,
                    void 0;
                pt(),
                C.displayDuration && nt(),
                O()
            }
            dt.init = !0
        }
        function pt() {
            return I(),
            L() ? (R(),
            $(),
            K(),
            B(),
            lt(),
            void 0) : !1
        }
        var dt = this;
        return dt.container = o,
        ct(),
        dt.init ? {
            media: dt.media,
            play: j,
            pause: D,
            restart: z,
            rewind: W,
            forward: Y,
            seek: z,
            source: ot,
            poster: it,
            setVolume: $,
            togglePlay: _,
            toggleMute: G,
            toggleCaptions: Q,
            toggleFullscreen: X,
            isFullscreen: function() {
                return dt.isFullscreen || !1
            },
            support: function(e) {
                return a(dt, e)
            },
            destroy: ut,
            restore: ct
        } : {}
    }
    var F, C, S = {
        enabled: !0,
        debug: !1,
        seekTime: 10,
        volume: 5,
        click: !0,
        tooltips: !1,
        displayDuration: !0,
        iconPrefix: "icon",
        selectors: {
            container: ".player",
            controls: ".player-controls",
            labels: "[data-player] .sr-only, label .sr-only",
            buttons: {
                seek: '[data-player="seek"]',
                play: '[data-player="play"]',
                pause: '[data-player="pause"]',
                restart: '[data-player="restart"]',
                rewind: '[data-player="rewind"]',
                forward: '[data-player="fast-forward"]',
                mute: '[data-player="mute"]',
                volume: '[data-player="volume"]',
                captions: '[data-player="captions"]',
                fullscreen: '[data-player="fullscreen"]'
            },
            progress: {
                container: ".player-progress",
                buffer: ".player-progress-buffer",
                played: ".player-progress-played"
            },
            captions: ".player-captions",
            currentTime: ".player-current-time",
            duration: ".player-duration"
        },
        classes: {
            videoWrapper: "player-video-wrapper",
            embedWrapper: "player-video-embed",
            type: "player-{0}",
            stopped: "stopped",
            playing: "playing",
            muted: "muted",
            loading: "loading",
            tooltip: "player-tooltip",
            hidden: "sr-only",
            hover: "player-hover",
            captions: {
                enabled: "captions-enabled",
                active: "captions-active"
            },
            fullscreen: {
                enabled: "fullscreen-enabled",
                active: "fullscreen-active",
                hideControls: "fullscreen-hide-controls"
            }
        },
        captions: {
            defaultActive: !1
        },
        fullscreen: {
            enabled: !0,
            fallback: !0,
            hideControls: !0
        },
        storage: {
            enabled: !0,
            key: "plyr_volume"
        },
        controls: ["restart", "rewind", "play", "fast-forward", "current-time", "duration", "mute", "volume", "captions", "fullscreen"],
        i18n: {
            restart: "Restart",
            rewind: "Rewind {seektime} secs",
            play: "Play",
            pause: "Pause",
            forward: "Forward {seektime} secs",
            played: "played",
            buffered: "buffered",
            currentTime: "Current time",
            duration: "Duration",
            volume: "Volume",
            toggleMute: "Toggle Mute",
            toggleCaptions: "Toggle Captions",
            toggleFullscreen: "Toggle Fullscreen"
        }
    };
    e.supported = function(e) {
        var t, n, a = r(), s = "IE" === a.name && a.version <= 9, o = /iPhone|iPod/i.test(navigator.userAgent), i = !!document.createElement("audio").canPlayType, l = !!document.createElement("video").canPlayType;
        switch (e) {
        case "video":
            t = l,
            n = t && !s && !o;
            break;
        case "audio":
            t = i,
            n = t && !s;
            break;
        case "youtube":
            t = !0,
            n = !s && !o;
            break;
        default:
            t = i && l,
            n = t && !s
        }
        return {
            basic: t,
            full: n
        }
    }
    ,
    e.setup = function(t) {
        if (C = w(S, t),
        !C.enabled || !e.supported().basic)
            return !1;
        for (var n = document.querySelectorAll(C.selectors.container), r = [], a = n.length - 1; a >= 0; a--) {
            var s = n[a];
            if ("undefined" == typeof s.plyr) {
                var o = new T(s);
                s.plyr = Object.keys(o).length ? o : !1,
                "function" == typeof C.onSetup && C.onSetup.apply(s.plyr)
            }
            r.push(s.plyr)
        }
        return r
    }
}(this.plyr = this.plyr || {});
